package net.hvacapp.cmvrfforandroid.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import net.hvacapp.cmvrfforandroid.R;

/**
 * TODO: document your custom view class.
 */
public class UserSelectionView extends RelativeLayout {
    private RelativeLayout mUserSelectionLl;
    private TextView mTitleTv;
    private TextView mSelectionInfoTv;
    private ImageView mSelIv;

    public UserSelectionView(Context context) {
        super(context);
        init(context, 0);
    }

    public UserSelectionView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context, 0);
    }

    public UserSelectionView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init(context, defStyle);
    }

    public void hideSelectHint() {
        mSelIv.setVisibility(INVISIBLE);
    }

    public TextView getInfoTv() {
        return mSelectionInfoTv;
    }

    public void setOnClickListener(OnClickListener onClickListener) {
        mUserSelectionLl.setOnClickListener(onClickListener);
    }

    public void setTitleString (String title) {
        mTitleTv.setText(title);
    }

    public void setInfoString (String info) {
        mSelectionInfoTv.setText(info);
    }

    private void init(Context context, int defStyle) {
        LayoutInflater.from(context).inflate(R.layout.view_user_selection, this,
                true);
        mTitleTv = (TextView) findViewById(R.id.tv_title);
        mSelectionInfoTv = (TextView) findViewById(R.id.tv_info);
        mUserSelectionLl = (RelativeLayout) findViewById(R.id.ll_user_selection);
        mSelIv = (ImageView) findViewById(R.id.iv_selection_hint);
    }


}
